{% extends "base.html" %}
{% block title %}
  {% if error %}
    Problem starting jobs
  {% else %}
    Backup jobs kicked off
  {% endif %}
{% endblock %}
{% block body %}
  <h2>Backup Job Status</h2>
  {% if xsrf_error %}
    <div class="ae-errorbox">
      The token used to submit this form has expired.
    </div>
  {% else %}
    {% if job_list %}
      <div class="ae-message">
        <div class="ae-alert">
          The following jobs were launched by MapReduce.
        </div>
        <p>Each job's status will only be available for as long as the
        job takes to complete.  Once the job is complete, it will remove the
        status objects from your datastore.  Click a job's id for status
        information.
        </p>
      </div>
      {% for id in job_list %}
        <p>Backup <a href="{{mapreduce_detail|escape}}{{id|escape}}">job with id
          {{id|escape}}</a>
            kicked off.</p>
      {% endfor %}
    {% endif %}
    {% if task_list %}
      <div class="ae-message">
        <div class="ae-alert">
          The followings tasks were submitted and will initiate MapReduce jobs.
        </div>
        <ul>
          {% for task_name in task_list %}
            <li>{{ task_name }}</li>
          {% endfor %}
        </ul>
        <p>Once job's are created their status will only be available for as
        long as the job takes to complete. Once the job is complete, it will
        remove the status objects from your datastore.
        Click a job's id for status information.
        </p>
      </div>
    {% endif %}
    {% if remote_job %}
      <div class="ae-message">
        <div class="ae-alert">
          Backup was initiated as a remote job.
        </div>
      </div>
    {% endif %}
    {% if error %}
      <p>There was a problem kicking some off the jobs/tasks:
        <pre><code>{{error|escape}}</code></pre>
      </p>
    {% endif %}
  {% endif %}
  <a href="{{datastore_admin_home}}">Back to Datastore Admin</a>
{% endblock %}

